<?php
	
	$dns = 'mysql:dbname=test;host=localhost';
	$user = 'root';
	$password = 'admin';
	try{
		$PDO = new PDO($dns, $user, $password);
	}catch(PDOException $e){
		echo "Error:".$e->getMessage();
	}
	
	
	$sql = "SELECT * FROM `ipadds`";

/*	
	$queryObj = $PDO->query($sql);
	
	while($stmt =$queryObj->fetch()){
		echo $stmt['IpAdds']."---".date('Y-m-d H:i:s',$stmt['TimeDate'])."<hr />";
	}
*/

	$queryObj = $PDO->prepare($sql);

	$queryObj->execute();
	$result = $queryObj->fetchAll();
	foreach($result as $v){
		echo $v['IpAdds']."===".date('Y-m-d',$v['TimeDate'])."<hr />";
		
	}


